<?php

namespace App\Transformers\Web;

use League\Fractal\TransformerAbstract;

class ExaminationTransformer extends TransformerAbstract
{
    /**
     * 考试安排的转换层
     * @param  $examination
     * @return array
     */
    public function transform($examination)
    {
        return [
            'id' => $examination->id,
            'name' => $examination->name,
            'status' => $examination->status,
            'start_time' => $examination->start_time,
            'subject' => $examination->subject->name,
            'already_num' => $examination->result,
        ];
    }
}

